package diona.clipboard;

import diona.dao.SharedFileDao;

import java.io.File;
import java.util.Collections;
import java.util.List;

/**
 * User: anton
 * Date: 20.03.11 14:02
 */
public class FileListItem implements ClipboardItem
{
    private final List<File> files;

    public FileListItem(List<File> files)
    {
        this.files = Collections.unmodifiableList(files);
    }

    public List<File> getFiles()
    {
        return files;
    }

    public void save(SharedFileDao dao)
    {
        for (File file : files) {
            dao.add(file.getAbsolutePath());
        }
    }

    public String getDescription()
    {
        return String.format("List of %d files", files.size());
    }
}
